package com.typhoon.spring_jdbctemplate.compare;

import java.util.ArrayList;
import java.util.List;

/**
 * 对比结果容器
 * 
 * @author Typhoon
 * @date 2017-09-17 11:04 Sunday
 * @since V2.0
 * @param <T>
 */
public class CompareResult<T> {
	/**
	 * 需要更新的数据列表
	 */
	private List<T> updateList;

	/**
	 * 需要删除的数据列表
	 */
	private List<T> deleteList;

	/**
	 * 需要新增的数据列表
	 */
	private List<T> newList;

	public CompareResult() {
		this.updateList = new ArrayList<>();

		this.deleteList = new ArrayList<>();

		this.newList = new ArrayList<>();
	}

	/**
	 * 总共需要改变的数量
	 * 
	 * @author Typhoon
	 * @date 2017-09-17 11:05 Sunday
	 * @since V2.0
	 * @return
	 */
	public int getChangeCount() {
		return (this.updateList.size() + this.deleteList.size() + this.newList.size());
	}

	public List<T> getUpdateList() {
		return this.updateList;
	}

	public void setUpdateList(List<T> updateList) {
		this.updateList = updateList;
	}

	public List<T> getDeleteList() {
		return this.deleteList;
	}

	public void setDeleteList(List<T> deleteList) {
		this.deleteList = deleteList;
	}

	public List<T> getNewList() {
		return this.newList;
	}

	public void setNewList(List<T> newList) {
		this.newList = newList;
	}
}